package com.google.gwt.gfx.client.services;

import com.google.gwt.gfx.client.shared.Viewport;

public interface RefreshService<V extends Viewport> {

	/**
	 * Gets true if this service could be binded with the view.
	 * 
	 * @param view
	 *            view for binding
	 * @return true if bindable
	 */
	boolean isBindableWith(Viewport view);

	/**
	 * Gets true if this service enables query.
	 * 
	 * @return true if this service enables query
	 */
	boolean isEnabled();

	String toString();

	/**
	 * Binds a viewport.
	 * 
	 * @param viewport
	 *            binded viewport
	 */
	void tryBind(Viewport viewport);

	/**
	 * Gets a reference query window, usually from a {@link MapViewer}.
	 * 
	 * @return reference query window
	 */
	V viewport();

}
